package com.xhcl.web.controller.system;

import java.util.List;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xhcl.common.annotation.Log;
import com.xhcl.common.enums.BusinessType;
import com.xhcl.system.domain.TSrhsJtmx;
import com.xhcl.system.service.ITGgHsdwService;
import com.xhcl.system.service.ITGgKmdmService;
import com.xhcl.system.service.ITSrhsJtmxService;
import com.xhcl.common.core.controller.BaseController;
import com.xhcl.common.core.domain.AjaxResult;
import com.xhcl.common.utils.StringUtils;
import com.xhcl.framework.uitls.poi.ExcelUtil;
import com.xhcl.common.core.page.TableDataInfo;

/**
 * 单位项目查询Controller
 * 
 * @author xhcl
 * @date 2020-08-30
 */
@Controller
@RequestMapping("/system/dwxmcx")
public class TSrhsDwxmcxController extends BaseController
{
    private String prefix = "system/dwxmcx";

    @Autowired
    private ITSrhsJtmxService tSrhsJtmxService; 


    @RequiresPermissions("system:dwxmcx:view")
    @GetMapping()
    public String dwxmcx()
    {
        return prefix + "/dwxmcx";
    }

    /**
     * 查询单位项目查询列表
     */
    @RequiresPermissions("system:dwxmcx:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(TSrhsJtmx tSrhsJtmx)
    {
        startPage();
        List<TSrhsJtmx> list = tSrhsJtmxService.selectTSrhsJtmxFordwxmList(tSrhsJtmx);
        return getDataTable(list);
    }

    /**
     * 导出单位项目查询列表
     */
    @RequiresPermissions("system:dwxmcx:export")
    @Log(title = "单位项目查询", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    @ResponseBody
    public AjaxResult export(TSrhsJtmx tSrhsJtmx)
    {
        List<TSrhsJtmx> list = tSrhsJtmxService.selectTSrhsJtmxFordwxmList(tSrhsJtmx);
        ExcelUtil<TSrhsJtmx> util = new ExcelUtil<TSrhsJtmx>(TSrhsJtmx.class);
        return util.exportExcel(list, "dwxmcx");
    }
    
   

}
